package w2

object LazyVar {
  def main(args: Array[String]): Unit = {
    //变量的懒加载
    var x: Int = 22
    lazy val y: Int = x
    x = 78
    println(s"x=${x}")
    println(s"y=${y}")
  }
}
